from __future__ import absolute_import

from datetime import date

import flask
import flask
from flask import make_response, current_app, Flask
from flask.json import JSONEncoder
from flask_restx import Resource, Api

# from app import app

#

class CustomJSONEncoder(JSONEncoder):
    """处理返回时间，直接使用 jsonify 会把时间处理成 GMT 时间"""

    def default(self, o):
        if isinstance(o, date):
            return o.isoformat(sep=' ', timespec='auto')
        return super().default(o)

